#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    int t;
    cin >> t;
    vector<vector<int>> v(t, vector<int>(6));
    for (int i = 0;i < t;i++)
    {
        for (int j = 0;j < 6;j++)
        {
            cin >> v[i][j];
        }
    }
    for (int i = 0;i < t;i++)
    {
        int flag = 1;
        double sum = 0;
        for (auto e : v[i]) sum += e;
        sort(v[i].begin(), v[i].end());
        for (int m = 0;m <= 3;m++)
        {
            for (int j = m + 1;j <= 4;j++)
            {
                for (int k = j + 1;k <= 5;k++)
                {
                    if (v[i][m] + v[i][j] > v[i][k])
                    {
                        int end = 5;
                        while (end == k || end == j || end == m)
                        {
                            end--;
                        }
                        if (sum - v[i][m] - v[i][j] - v[i][k] - v[i][end] > v[i][end])
                        {
                            cout << "Yes" << endl;
                            flag = 0;
                            break;
                        }
                    }

                }
                if (flag == 0) break;

            }
            if (flag == 0) break;
        }
        if (flag == 1)
        {
            cout << "No" << endl;
        }
    }
    return 0;
}